<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019-10-24
 * Time: 上午 11:10
 */

namespace App\Lib\DingDingNotice;


class Order extends BaseNotice
{

    public function __construct($data,$token,$atMobiles = [],$isAtall = false)
    {
        $str    =   '';
        foreach ($data as $k=>$v){

            $str .= "\n\n > 店铺 : ".$v['shop_name'];
            $str .= "\n\n > 订单号 : ".$v['order_id'];
            $str .= "\n\n > 手机号 : ".$v['post_tel'];
            $str .= "\n\n > 下单时间 : ".$v['create_time'];
            if(date("Y-m-d H:i:s") > date("Y-m-d").' 08:30:00' && $v['create_time'] < date("Y-m-d").' 08:30:00'){
                $str .= "\n\n >此订单已提供给厂家，下单人员可以处理退款";
            }else{
                $str .= "\n\n >此订单未提供给厂家，下单人员跟进标记核实";
            }
            $str .= "\n\n >=======================";
        }



        $str .= "\n\n >发送时间".date("Y-m-d H:i:s");

        $this->template = [
            "title"=>'订单退款通知',
            'text'=>"#### 订单退款通知
            \n\n > $str"
        ];

        $this->token = $token;
        $this->atMobiles = $atMobiles;
        $this->isAtall = $isAtall;

    }

}